<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        body {
            background-image: url("./images/xiaojie1.jpg");
        }

        #open_adv {
            display: none;
        }
    </style>


</head>

<body>

    <div>
        <div id="advertisement">
            <button type="button" onclick="close_advertisement()">
                关闭广告
            </button>
            <div>
                <img src="./images/float_advclose1.gif" alt="" style="width: 200px;">
            </div>

        </div>

        <button type="button" id="open_adv" onclick="open_advertisement()">
            显示广告
        </button>
    </div>


    <script>
        var adv = document.getElementById("advertisement");
        var open_adv = document.getElementById("open_adv");
        function close_advertisement() {
            // alert("关闭广告");
            adv.style.display = "none";
            open_adv.style.display = "block";
        }

        function open_advertisement() {
            // alert("打开广告");
            adv.style.display = "block";
            open_adv.style.display = "none";
        }
    </script>
</body>

</html>